import AuthenticationSelect from "@/components/AuthenticationSelect"
import { AntdModalProps } from "@/hooks/useAntdModal"
import useQuery from "@/hooks/useQuery"
import { queryProjectPipeline, saveApp, saveCodeupReleasePlan } from "@/service/deliver"
import { useRequest } from "ahooks"
import { Button, Form, Input, Modal, Radio, Select, Space } from "antd"
import AppSelect from "./AppSelect"


const SaveReleasePlan = ({ form, modalProps,payload, closeModal, refresh }: AntdModalProps) => {
  const query = useQuery()
  const onOk = async () => {
    let data = await form.validateFields()
    
    await saveCodeupReleasePlan(data)
    refresh()
    closeModal()
  }
  return <Modal  {...modalProps} onOk={onOk}>
    <Form labelCol={{ span: 6 }} form={form} initialValues={{
    }}>
      <Form.Item hidden name='id' >
        <Input />
      </Form.Item>
      <Form.Item label='应用' name='appId'  rules={[{
        required: true,
        message: '应用名称'
      }]}>
        <AppSelect />
      </Form.Item>
      <Form.Item label="迭代计划名称" name='name' rules={[{
        required: true,
        message: '迭代计划名称'
      }]}>
        <Input />
      </Form.Item>
      <Form.Item label="版本" name='version' rules={[{
        required: true,
        message: 'Git仓库'
      }]}>
        <Input  />
      </Form.Item>
 


    </Form>
  </Modal>
}
export default SaveReleasePlan
